﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Windows.Forms;

namespace TreeLayoutPlayground
{
    static class Program
    {
        //static int seed = 0;// 0, 3
        //static int MaxHeight = 5;
        //static int MaxWidth = 3;
        //static string filename = FindFirstUnusedName("CSGLayoutTree");
        
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new InteractiveViewer());

            //Random r = new Random(seed);
            //Queue<TreeType> queue = new Queue<TreeType>();
            //TreeType graph = new TreeType(r);
            //queue.Enqueue(graph);
            //
            //do
            //{
            //    TreeType cur = queue.Dequeue();
            //
            //    if (r.NextDouble() > ((MaxHeight - cur.TreeHeight + 1) / (double)MaxHeight)) { continue; }
            //
            //    int num = r.Next(1, MaxWidth + 1);
            //    if (num == 0) { continue; }
            //
            //    for (; num > 0; num--)
            //    {
            //        TreeType t = new TreeType(r);
            //        cur.AddChild(t);
            //        queue.Enqueue(t);
            //    }
            //} while (queue.Count > 0 && graph.TreeHeight < MaxHeight);
            //
            //DrawableViewer dv = new DrawableViewer(graph, "Thing");
            //graph.SaveImage(filename);
            //
            //Application.Run(dv);
        }

        //private static string FindFirstUnusedName(string name)
        //{
        //    int num = 0;
        //    do
        //    {
        //        string fn = string.Format("{0}_r{1}_h{2}_w{3}_{4}.png", name, seed, MaxHeight, MaxWidth, num);
        //        if (!File.Exists(fn)) { return fn; }
        //        num++;
        //    } while (true);
        //}
    }
}
